Two-dimensional wavelet families

father2d(x, y, [j, kx, ky], s) Returns the value at (x,y) of the 2D father wavelet packet based on the filter represented by string s at scale j and position (kx,ky).

mother2d(x, y, [j, kx, ky], s, ds) Returns the value at (x,y) of the 2D mother wavelet packet based on the filter represented by string s at scale j and position (kx,ky).

dlfather2d(x, y, [j, kx, ky], s) Returns the value at (x,y) of the 2D dual father wavelet packet based on the filter represented by string s at scale j and position (kx,ky).

dlmother2d(x, y, [j, kx, ky], s, ds) Returns the value at (x,y) of the 2D dual mother wavelet packet based on the filter represented by string s at scale j and position (kx,ky).

Arguments:

x and y are real scalars.

j (optional) is an integer. If j is omitted, it is assumed to be 0.

kx and ky (optional) are integers. If omitted, they are assumed to be 0.

s is a string representing a wavelet filter. Valid strings consist of a letter(s) followed by a number(s). The following letters, which indicate wavelet filters, are allowed:

d, daub, daublet, s, symm, symmlet, c, coif, coiflet, bl, bs, Bspline, haar

The number(s) which follow the letters must be valid for the wavelet filter to which the letters refer.

For example, valid strings for s are "d4" for daublet(4), "s12" for symmlet(12), and "bs33" for Bspline(3,3).

ds is a one of the following strings: "H", "V", or "D" which indicate, respectively, a horizontal, vertical, or diagonal mother wavelet.

Launch E-Book Example


Wavelet families

father(x,[j,k],s) Returns the value at x of the father wavelet packet based on the filter represented by string s at scale j and position k.

mother(x,[j,k],s) Returns the value at x of the mother wavelet packet based on the filter represented by string s at scale j and position k.

dlfather(x,[j,k],s) Returns the value at x of the dual father wavelet packet based on the filter represented by string s at scale j and position k.

dlmother(x,[j,k],s) Returns the value at x of the dual mother wavelet packet based on the filter represented by string s at scale j and position k.

Arguments:

x is a real scalar.

j (optional) is an integer. If j is omitted, it is assumed to be 0.

k (optional) is an integer. If k is omitted, it is assumed to be 0.

s is a string representing a wavelet filter. Valid strings consist of a letter(s) followed by a number(s). The following letters, which indicate wavelet filters, are allowed:

d, daub, daublet, s, symm, symmlet, c, coif, coiflet, bl, bs, Bspline, haar

The number(s) which follow the letters must be valid for the wavelet filter to which the letters refer.

For example, valid strings for s are "d4" for daublet(4), "s12" for symmlet(12), and "bs33" for Bspline(3,3).


Basis extraction

extract_basis(T,b) Returns coefficients in the basis specified by b from a 1D or 2D packet table T.

Arguments:

T is a vector of nested arrays representing a 1D or 2D wavelet packet table or a 1D or 2D cosine packet table.

b is a 2- or 3-column matrix representing a packet basis.


Best basis

best_basis(T,f) Returns the best packet basis from a 1D or 2D packet table T, based on the additive cost function f.

basis_display2d(b) Creates a matrix for graphically displaying 2 dimensional basis b.

Arguments:

T is a vector of nested arrays representing a 1D or 2D wavelet packet table or a 1D or 2D cosine packet table.

f is an additive cost function such as the entropy function f(x):=-x2*log(x2).

b is a 3-column matrix representing a 2D packet basis.

Notes:

To see view the matrix returned by basis_display2d graphically, choose Picture from the Insert menu and enter the basis_display2d function in the placeholder.


Wavelet packet transforms

wpt(a,b,f,[o,[i]]) Returns the wavelet packet transform of the array a with respect to basis or level b by the wavelet filter f. f can have an offset o and negation i .

iwpt(w,b,f,[o,[i]]) Returns the inverse wavelet packet transform of the array w with respect to basis b by the wavelet filter f. f can have an offset o and negation i .

Arguments:

a is a vector or matrix. The length of a must be divisible by 2level if it is a vector. The number of rows and columns of a must be divisible by 2level if it is a matrix.

b represents a level or a packet basis. For wpt, b is an integer or a 2- or 3-column matrix representing a packet basis. For iwpt, b must be a 2- or 3-column matrix representing a packet basis.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients. f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.

w is a vector or a matrix.

Launch E-Book Example Launch E-Book Example


Interval wavelet packet transforms

wpti(a,b,f) Returns the interval wavelet packet transform of the array a with respect to basis or level b by the wavelet filter f.

iwpti(w,b,f) Returns the inverse interval wavelet packet transform of the array w with respect to basis b by the wavelet filter f.

Arguments:

a is an vector or matrix. If a is a vector, the length of a must be divisible by 2level. Additionally, length(a)/ 2level must be greater than or equal to m. If a is a matrix, the number of rows and columns of a must both be divisible by 2level . Additionally, rows(a)/ 2level and cols(a)/ 2level must be greater than or equal to m. For information on m, see the description of f below.

b represents a level or a packet basis. For wpti, b is an integer or a 2- or 3-column matrix representing a packet basis. For iwpti, b must be a 2- or 3-column matrix representing a packet basis.

f is a vector resulting from daublet(m) (where m is an even integer between 4 and 6, inclusive) or symmlet(m) (where m is an even integer between 4 and 16, inclusive).

w is a vector or a matrix.

Launch E-Book Example using wpti

Launch E-Book Example using iwpti


Symmetric wavelet packet transforms

wpts(a,b,f) Returns the symmetric wavelet packet transform of the array a with respect to basis or level b by the wavelet filter f.

iwpts(w,b,f) Returns the inverse symmetric wavelet packet transform of the array w with respect to basis b by the wavelet filter f.

Arguments:

a is a vector or matrix. The length of a must be greater than or equal to 2level if a is a vector. The number of rows and columns of a must both be greater than or equal to 2level if a is a matrix.

b represents a level or a packet basis. For wpts, b is an integer or a 2- or 3-column matrix representing a packet basis. For iwpts, b must be a 2- or 3-column matrix representing a packet basis.

f is either a vector or a 2-column matrix, usually resulting from bl or Bspline or daublet(2).

w is a vector or a matrix.

Launch E-Book Example of wpts Launch E-Book Example of iwpts


Wavelet packet bases

create_level(n,d) Returns a d-dimensional wavelet packet basis of all wavelet packets at the level n.

wavebs(n,d) Returns the d-dimensional wavelet packet basis corresponding to the wavelet transform of level n.

Arguments:

n is a non-negative integer.

d is 1 or 2, representing the dimension of the data being processed.


Wavelet filters

bl(n) Returns the Battle-Lemarie wavelet based upon the degree n cardinal B-spline. n is an integer between 0 and 6, inclusive.

Bspline(m,n) Returns the analysis and synthesis low-pass filters for a spline-based biorthogonal wavelet. When m=1, n is 1,3, or 5. When m=2, n is 2,4,6 or 8. When m=3, n is 1,3,5,7, or 9.

coiflet(n) Returns the low-pass filter of the n-coefficient Coiflet wavelet. n is 6, 12, 18, 24, or 30.

daublet(n) Returns the low-pass filter of the n-coefficient minimum phase Daubechies wavelet. n is an even integer between 2 and 20, inclusive.

symmlet(n) Returns the smoothing filter of the n-coefficient least asymmetric Daubechies wavelet. n is an even integer between 4 and 20, inclusive.

Arguments:

n is an integer. Restrictions on n are noted above.

m is 1, 2, or 3.

Notes:

The first column of the matrix returned by Bspline contains the analysis filter. The second column contains the synthesis filter.


User-defined wavelets

Many of the functions in the Wavelets Extension Pack work with user-defined filters which are based on other known filters. To specify a user-defined filter, include a filter f and an offset o and/or negation i as arguments to any of the following functions:

dwt and idwt

wpt and iwpt

wavelet and dlwavelet

wavelet2d and dlwavelet2d

waveterp

waveterp2d


Wavelet packets

wavelet(x,j,k,n,f,[o,[i]]) Returns the value at x of the nth wavelet packet based on filter f at scale j and position k. f can have an offset o and negation i .

dlwavelet(x,j,k,n,f,[o,[i]]) Returns the value at x of the nth dual wavelet packet based on the filter f at scale j and position k. f can have an offset o and negation i .

Arguments:

x is a real scalar.

j is an integer.

k is an integer.

n is a non-negative integer.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients. f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.

Notes:

The wavelet packets are taken in sequency order.


Two-dimensional wavelet packets

wavelet2d(x,y,j,kx,ky,m,n,f,[o,[i]]) Returns the value at (x,y) of the (m,n)th wavelet packet based on filter f at scale j and position (kx,ky). f can have an offset o and negation i .

dlwavelet2d(x,y,j,kx,ky,m,n,f,[o,[i]]) Returns the value at (x,y) of the (m,n)th dual wavelet packet based on filter f at scale j and position (kx,ky). f can have an offset o and negation i .

Arguments:

x and y are real scalars.

j , kx, and ky are integers.

m and n are non-negative integers.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients. f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.

Notes:

The wavelet packets are taken in sequency order.


Wavelet transforms

dwt(a,n,f,[o,[i]]) Returns the n-level wavelet transform of the array a by the wavelet filter f. f can have an offset o and negation i .

idwt(a,n,f,[o,[i]]) Returns the n-level inverse wavelet transform of the array a by the wavelet filter f. f can have an offset o and negation i .

Arguments:

a is a vector whose length is divisible by 2n, or a is an array, the number of rows and columns of which is divisible by 2n.

n is an integer.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients. f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.


Interval wavelet transforms

dwti(a,n,f) Returns the n-level interval wavelet transform of the array a by the wavelet filter f.

idwti(a,n,f) Returns the n-level inverse interval wavelet transform of the array a by the wavelet filter f.

Arguments:

a is a vector or matrix. If a is a vector, length(a)/2n must be an integer and length(a)/2n must be greater than or equal to m, where symmlet(m) or daublet(m) is being used as f. If a is a matrix, the row and column lengths must satisfy these requirements.

n is an integer.

f is a vector resulting from daublet(m) (where m is an even integer between 4 and 6, inclusive) or symmlet(m) (where m is an even integer between 4 and 16, inclusive).


Symmetric wavelet transforms

dwts(a,n,f) Returns the n-level symmetric wavelet transform of the array a by the wavelet filter f.

idwts(a,n,f) Returns the n-level inverse symmetric wavelet transform of the array a by the wavelet filter f.

Arguments:

a is a vector whose length is [image] 2n, or a is a matrix with at least 2n rows and columns.

n is an integer.

f is either a vector or a 2-column matrix resulting from bl or Bspline or daublet(2).


Local cosine transforms

lct(a,n,f) Returns the n-level local cosine packet table for the data array a using data taper function f.

ilct(w,n,b,f) If w is an array of cosine packet coefficients constructed from a cosine packet table with n levels, returns the inverse cosine packet transform with respect to the basis specified by b, using data taper function f.

cpt(a,n) Returns the n-level local cosine packet table for the data array a.

icpt(w,n,b) If w is an array of cosine packet coefficients constructed from a cosine packet table with n levels, returns the inverse cosine packet transform with respect to the basis specified by b.

Arguments:

a is a vector whose length is divisible by 2n+1. Alternatively, a is a matrix whose rows and columns lengths are divisible by 2n+1.

n is an integer.

w is a vector or matrix.

b is a 2- or 3-column matrix representing a cosine packet basis.

f is a function. Functions that are most commonly used are: box, poly1, poly2, poly3, poly4, and trig. These tapers are defined in the file WAVEDEF.MCD. You can insert this file as a reference or copy the functions you want to use and paste them into your own worksheet.

Notes:

  • The argument n used in icpt must be the n the used in lct. (This may be larger than the number of levels present in the basis b.) ilct also requires that you specify the taper which was used in lct.

  • cpt and icpt use the default "trig"data taper.


Wavelet interpolation

waveterp(x,v,j,n,f,[o,[i]]) Returns the value at x of the periodic multiresolution approximation of v corresponding to the nth subband at level j, based on the filter f. f can have an offset o and negation i.

swaveterp(x,v,j,n,f) Returns the value at x of the symmetric multiresolution approximation of v corresponding to the nth subband at level j, based on the filter f.

Arguments:

x is a real-valued scalar at which to evaluate the component.

v is a vector, a one dimensional wavelet packet transform. For waveterp, rows(v) must be divisible by 2j. For swaveterp, rows(v) [image] 2j.

j is an integer.

n is an integer less than 2j giving the index of the desired subband in sequency order.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients.

  • For waveterp, f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

  • For swaveterp, f is bl, Bspline, or daublet(2).

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.


Two-dimensional wavelet interpolation

waveterp2d(x,y,v,j,m,n,f,[o,[i]]) Returns the value at (x,y) of the periodic multiresolution approximation of v corresponding to subband (m,n) at level j, based on the filter f. f can have an offset o and negation i.

swaveterp2d(x,y,v,j,m,n,f) Returns the value at (x,y) of the symmetric multiresolution approximation of v corresponding to subband (m,n) at level j, based on the filter f.

Arguments:

x and y are real scalars.

v is a matrix. For waveterp2d, the rows(v) and cols(v) must be divisible by 2j. For swaveterp2d, rows(v) [image] 2j and cols(v) [image] 2j.

j is an integer.

m and n are integers less than 2j giving the indices of the desired subband in sequential order.

f is a vector of low pass filter coefficients for an orthonormal filter. Alternatively, for a biorthogonal filter, f is a 2-column matrix whose first column contains the low pass filter coefficients and whose second column contains the inverse low pass filter coefficients.

  • For waveterp2d, f is the result from a function, such as daublet or Bspline, that creates the filter coefficients for a particular wavelet or f is an array of user-defined filter coefficients.

  • For swaveterp2d, f is bl, Bspline, or daublet(2).

o (optional) is a real scalar, for an orthonormal filter, or a 1x2 matrix of real scalars for a biorthogonal filter. o is the offset(s) corresponding to the filter f. If not specified, o is a default offset.

i (optional) is zero or one for an orthonormal filter or, for a biorthogonal filter, i is a 1x2 matrix whose elements are zero or one. i = 0 specifies no negation of the default high pass coefficients; i = 1 specifies negation. If not specified, i = 0.


Function evaluation on bases

evalbs(w,b,f) Returns the result of applying the function f to each subband of the wavelet packet basis b which comprises the coefficients in w. Returns a matrix whose rows describe the subband to which f was applied, followed by the values of the function on that subband.

applybs(w,b,f) Returns the result of applying the function f to each subband of the wavelet packet basis b which comprises the coefficients in w. Returns a matrix the same size as w.

Arguments:

w is a vector or matrix of wavelet packet coefficients to which to apply the function.

b is a 2- or 3-column matrix representing a packet basis.

f is the name of a function such as f(x), where x is an array. The function must result in a real scalar or a real array for evalbs; it must result in a real array for applybs. For applybs, the number of rows and columns of f(x) should match the number of rows and columns of x.


Function evaluation on tables

evaltbl(T,f) Returns the result of applying the function f to each subband of the wavelet packet table T. Returns a matrix whose rows describe the subband to which f was applied, followed by the value of the function on that subband.

applytbl(T,f) Returns a new wavelet packet table by applying the vector-valued function f to each subband of the wavelet packet table T. Returns a nested array.

Arguments:

T is a nested array, a wavelet packet table to which to apply the function.

f is the name of a function such as f(x), where x is an array. The function must result in a real scalar or a real array for evaltbl; it must result in a real array for applytbl. For applytbl, the number of rows and columns of f(x) should match the number of rows and columns of x.


Wavelet packet coefficients

get_detail(w,l) Returns the result of extracting the index-1 block of wavelet packet coefficients at level l from the wavelet packet transform w.

get_smooth(w,l) Returns the result of extracting the 0th block of wavelet packet coefficients at level l from the wavelet packet transform w.

put_detail(w,l,y) Returns the result of inserting the vector y into the index-1 block of wavelet packet coefficients of w at level l.

put_smooth(w,l,y) Returns the result of inserting the vector y into the index-0 block of wavelet packet coefficients of w at level l.

Arguments:

w is a vector whose length is at least 2l.

l is an integer.

y is a vector whose length is the same as the vector returned by get_detail(w,l) or get_smooth(w,l).

Notes:

get_smooth(w,l)=get_subband(w,l,0)

put_smooth(w,l,y)=put_subband(w,l,0,y)

get_detail(w,l)=get_subband(w,l,1)

put detail(w,l,y)=put_subband(w,l,1,y)

Launch E-Book Example on subband insertion Launch E-Book Example on subband extraction


Two-dimensional wavelet packet coefficients

get_detail2d(M,l,ds) Returns the result of extracting the subband indicated by the string ds of wavelet packet coefficients at level l from the 2-dimensional wavelet packet transform M.

get_smooth2d(M,l) Returns the result of extracting the (0,0)th subband of wavelet packet coefficients at level l from the 2-dimensional wavelet packet transform M.

put_detail2d(M,l,N,ds) Returns the result of inserting the matrix N into the subband indicated by the string ds of wavelet packet coefficients at level l of the 2-dimensional wavelet packet transform M.

put_smooth2d(M,l,N) Returns the result of inserting the matrix N into the index-(0,0) subband of wavelet packet coefficients at level l of the 2-dimensional wavelet packet transform M.

Arguments:

M is a matrix having at least 2l rows and columns.

l is an integer.

N is a matrix which is the same size as the matrix returned by get_detail2d(w,l) or get_smooth2d(w,l).

ds is either "H", "V", or "D", and indicates either the index-(1,0), index-(0,1), or index-(1,1) subband.

Notes:

get_smooth2d(w,l)=get_subband2d(w,l,0,0)

put_smooth2d(w,l,y)=put_subband2d(w,l,0,0,N)

get_detail2d(w,l,"H")=get_subband2d(w,l,1,0)
get_detail2d(w,l,"V")=get_subband2d(w,l,0,1)
get_detail2d(w,l,"D")=get_subband2d(w,l,1,1)

put_detail2d(w,l,N,"H")=put_subband2d(w,l,1,0,N)
put_detail2d(w,l,N,"V")=put_subband2d(w,l,0,1,N)
put_detail2d(w,l,N,"D")=put_subband2d(w,l,1,1,N)

Launch E-Book Example of subband insertion Launch E-Book Example of subband extraction


Subband extraction and insertion

get_subband(w,l,n) Returns the nth block of wavelet packet coefficients at level l extracted from the wavelet packet transform w.

put_subband(w,l,n,y) Returns the result of inserting the vector y into the nth block of wavelet packet coefficients at level l of the wavelet packet transform w.

Arguments:

w is a vector whose length is at least 2l.

l is an integer.

n is an integer less than 2l.

y is a vector the same length as the vector returned by get_subband.

Launch E-Book Example of subband insertion

Launch E-Book Example of subband extraction


Two-dimensional subband extraction and insertion

get_subband2d(M,l,m,n) Returns the result of extracting the (m,n)th subband of wavelet packet coefficients at level l from the 2-dimensional wavelet packet transform M.

put_subband2d(M,l,m,n,N) Returns the result of inserting the matrix N into the (m,n)th subband of wavelet packet coefficients at level l of the 2-dimensional wavelet packet transform M.

Arguments:

M is an array having at least 2l rows and columns.

l is an integer.

m and n are integers less than 2l corresponding to the row number and column number of the subband to extract.

N is a matrix. N is the same size as the matrix returned by get_subband2d.

Launch E-Book Example of subband insertion Launch E-Book Example of subband extraction


Icons

Look for these icons in the Help:

Click on them to launch the Wavelets Electronic Book which provides examples and additional information about the wavelets functions.


Using the Help system

Welcome!

Welcome to the HTML-based Wavelets Extension Pack Help system. The Help window has three tabs for accessing information:

  • The Contents tab gives you access to a Table of Contents which is useful when you need an overview of topics available and a guide through them.

  • The Index tab directs you to specific topics you request. Use the Index if you know the topic you are looking for.

  • The Search tab searches the entire help system for a word or phrase you request. Full-text searching is useful when you are looking for a certain word or phrase, rather than a topic.

When you double-click on a topic, it displays in the right-hand side of the window.


Level (description)

The level is the the argument b when b is in an integer.

When b is a 2- or 3-column matrix, level is the maximum value in the zeroth column of b.